package com.tucanstubs.android_wheresmystuff.items;

import java.util.Date;

/**
 * Subclass of items that represents a Found Item
 * @author team 37
 * @version 1.0 2/25/2012
 */
public class FoundItem extends Item{
	private ItemType type;
	
	/**
	 * Creates a found item with the inputed info
	 * @param name item's name
	 * @param description item's description
	 * @param location item's location
	 * @param dateEntered date item was created
	 * @param type item category
	 * @param id unique item id
	 */
	public FoundItem(String name, String description, double[] location,Date dateEntered, ItemType type,int id) {
		super(name, description, location, dateEntered,id);
		this.type=type;
	}
	/**
	 * returns string representation of the item
	 * @return string representation of the item
	 */
	public String toString(){
		return "Found Item:"+super.toString();
	}
	/**
	 * getter for item type
	 * @return the item's type
	 */
	public ItemType getItemType(){
		return this.type;
	}
	
	/**
	 * Overrides the equals method
	 * @param Object obj the object to compare with
	 * @return a boolean for whether the item is equal to the given item
	 */
	@Override
	public boolean equals(Object obj){
	    if (!(obj instanceof FoundItem))return false;
	    FoundItem objFound= (FoundItem)obj;
	    return this.getItemType().equals(objFound.getItemType()) && super.equals(obj);
	}

}
